#include <stdio.h>
#include <string.h>
#define BUFFER_SIZE 100

int main()
{
    int count = 0;
    char buffer[BUFFER_SIZE];
    printf("请输入一个字符串buffer：");
    scanf("%s", buffer);
    printf("buffer:%s\n",buffer);
    int len = strlen(buffer);
    printf("len:%d\n", len);
    
    if((len % 2) == 0)
    {
        for(int idx = 0; idx < (len / 2); idx++)
        {
            char ch[0];
            ch[0] = buffer[idx];
            buffer[idx] = buffer[len - idx - 1];
            buffer[len - idx - 1] = ch[0];
            printf("buffer:%c\n",buffer[0]);
        }
    }
    else
    {
        int len1 = len-1;
        for(int idx = 0; idx < (len1 / 2); idx++)
        {
            char ch;
            ch = buffer[idx];
            buffer[idx] = buffer[len - idx - 1];
            buffer[len - idx - 1] = ch;
        }          
    }
    printf("buffer:%c\n",buffer[0]);
    return 0;

}






